package com.dianqiu.common.web.action;


import java.util.ArrayList;
import java.util.List;
import com.dianqiu.base.action.BaseAction;
import com.dianqiu.common.bean.DqMatchHistTO;

public class MatchAction extends BaseAction {
	/**
	 * 
	 */
	public String listMatchDefault(){
		List matchList = this.getMatchHistService().getAllMatch();
		List<String> matchDateList = new ArrayList<String>();
		for(int i = 0 ; i < matchList.size() ; i++)
		{
			DqMatchHistTO dqMatchHistTO = (DqMatchHistTO) matchList.get(i);
			boolean flag = false;
			setMatchHistDateAndTime(dqMatchHistTO);
			String matchDate = dqMatchHistTO.getMatchDate();
			if(i == 0)
			{
				matchDateList.add(matchDate);
			}
			for(int j = 0 ; j < matchDateList.size() ; j++)
			{
				if(matchDate.equals(matchDateList.get(j)))
				{
					flag = true ;
				}
			}
			if(!flag)
			{
				matchDateList.add(matchDate);
			}
			
		}

		this.getRequest().setAttribute("matchList", matchList);
		this.getRequest().setAttribute("matchDateList", matchDateList);
		return "success";
	
	}
	
}
